home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{335C3C4F-E3F2-11D0-87E8-00A0C903B29D}#5.0#0"; "VCFI5.OCX"
- Begin VB.Form Form1
- Caption = "DragBar"
- ClientHeight = 8460
- ClientLeft = 1740
- ClientTop = 1545
- ClientWidth = 7740
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 8460
- ScaleWidth = 7740
- Begin VtChartLib.VtChart VtChart1
- Height = 5055
- Left = 840
- TabIndex = 0
- Top = 1680
- Width = 5775
- _ExtentX = 10186
- _ExtentY = 8916
- _0 = $"Dragbar.frx":0000
- _1 = $"Dragbar.frx":0405
- _2 = $"Dragbar.frx":080A
- _3 = $"Dragbar.frx":0C0F
- _4 = $"Dragbar.frx":1014
- _5 = $"Dragbar.frx":1419
- _6 = $"Dragbar.frx":181E
- _7 = $"Dragbar.frx":1C23
- _8 = $"Dragbar.frx":2028
- _9 = $"Dragbar.frx":242D
- _10 = $"Dragbar.frx":2832
- _11 = $"Dragbar.frx":2C37
- _12 = $"Dragbar.frx":303C
- _13 = $"Dragbar.frx":3441
- _count = 14
- _ver = 1
- End
- Begin VB.Label Label2
- Caption = "Click on a bar and drag the bar while holding down the mouse button. The bar height will automatically be adjusted."
- Height = 375
- Left = 240
- TabIndex = 2
- Top = 960
- Width = 6855
- End
- Begin VB.Label Label1
- Caption = "Simple First Impression Dragging Example"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FF0000&
- Height = 435
- Left = 240
- TabIndex = 1
- Top = 360
- Width = 6855
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Form_Load()
- Dragging = False
- VtChart1.AllowSeriesSelection = False ' So points can be selected
- VtChart1.DrawMode = VtChDrawModeBlit ' To reduce flicker
- End Sub
- Private Sub VtChart1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim ThePart%, TheSeries%, ThePoint%, I3%, I4%
- If Not Dragging Then
- VtChart1.TwipsToChartPart X, Y, ThePart, TheSeries, ThePoint, I3, I4
- If ThePart = VtChPartTypePoint Then
- OldX = X
- OldY = Y
- DragSeries = TheSeries
- DragPoint = ThePoint
- Dragging = True
- End If
- End If
- End Sub
- Private Sub VtChart1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim ThePart%, TheSeries%, ThePoint%, I3%, I4%
- Dim TheData As Double
- Dim TheNull As Integer
- If Dragging Then
- VtChart1.DataGrid.GetData DragPoint, DragSeries, TheData, TheNull
- If Y < OldY Then
- OldY = Y
- TheData = TheData + 1
- Else
- OldY = Y
- TheData = TheData - 1
- End If
- VtChart1.DataGrid.SetData DragPoint, DragSeries, TheData, TheNull
- VtChart1.Refresh
-
- ' Display Label To Show Current Value
- With VtChart1.Plot.SeriesCollection.Item(DragSeries).DataPoints.Item(DragPoint).DataPointLabel
- .LocationType = VtChLabelLocationTypeAbovePoint
- .Component = VtChLabelComponentValue
- .ValueFormat = "0.0"
- .Backdrop.Frame.Style = VtFrameStyleSingleLine
- End With
-
- End If
- End Sub
- Private Sub VtChart1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Turn Dragging Off
- Dragging = False
- ' Turn Point Label Off
- With VtChart1.Plot.SeriesCollection.Item(DragSeries).DataPoints.Item(DragPoint).DataPointLabel
- .LocationType = VtChLabelLocationTypeNone
- End With
- End Sub
-